import REGION_DATA from "china-area-data";
type Option = {
  value: string | number;
  label: string;
  children?: Option[];
};
const allProvince = REGION_DATA["86"];
const provinceData = ["不限"];
const provinceCascaderData: Option[] = [
  {
    value: "不限",
    label: "不限",
  },
];
for (const key in allProvince) {
  const item: Option = {
    value: allProvince[key],
    label: allProvince[key],
  };
  const children = [{
    value: "不限",
    label: "不限",
  }];
  const cities = REGION_DATA[key];
  if (Object.keys(cities).length > 1) {
    for (const key2 in cities) {
      children.push({
        value: cities[key2],
        label: cities[key2],
      });
    }
    item.children = children;
  }

  provinceData.push(allProvince[key]);
  provinceCascaderData.push(item);
}
export { provinceData, provinceCascaderData };
